﻿@model  IEnumerable<GSLMS.Entity.TB_SYS_EMP>
@{
    ViewBag.Title = "Selector";
}
<div class="pageContent"  style="height:330px;" >
    <table class="list" targetType="dialog"  width="97%" layoutH="40"   id="tableEmpSelectorList">
        <thead>
            <tr class="header">
                <th style="width:60px;">
                   <input type="checkbox" id="chkAll" name="chkAll" onclick="toCheckAll()" />
                   全选
                </th>
                <th style="width: 60px">
                    员工编号
                </th>
                <th style="width: 100px">
                    员工姓名
                </th>
                <th>
                    所属组织机构
                </th>
            </tr>
        </thead>
        @foreach (var item in Model)
        {            
            <tr target="Employee_ID" rel="@item.ID">
                <td>
                  @*@Html.CheckBox((item.ID+":"+item.EMPNAME))*@
                   <input type="checkbox" name="orgId" value="{empID:'@(item.ID)', empName:'@(item.EMPNAME)'}" />  
                </td>
                <td>
                    @item.EMPNO
                </td>
                <td>
                    @item.EMPNAME
                </td>
                <td>
                    @item.OrgName
                </td>
            </tr>
           
        }
    </table>
</div>
<div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button"  multLookup="orgId" >
                            确定选择</button></div>
                </div>
            </li>
        </ul>
</div>

<script type="text/javascript">
 
    function toCheckAll() {
        for (var i = 0; i < document.getElementById("tableEmpSelectorList").getElementsByTagName("INPUT").length; i++) {
            document.getElementById("tableEmpSelectorList").getElementsByTagName("INPUT")[i].checked = document.getElementById("chkAll").checked;
        }
    }
</script>